package com.kn.keywordmatch.config;

import com.kn.keywordmatch.service.DirectionKeywordIndex;
import com.kn.keywordmatch.service.KeywordIndex;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@Slf4j
@Configuration
public class BeanConfiguration {

    @Autowired
    private KeywordIndex keywordIndex;
    @Autowired
    private DirectionKeywordIndex directionKeywordIndex;


    @PostConstruct
    public void construct(){
        log.info("〓〓〓〓〓〓〓〓〓〓 索引初始化开始加载！！");
        keywordIndex.checkAndUpdateTries();
        directionKeywordIndex.checkAndUpdateTries();
        log.info("〓〓〓〓〓〓〓〓〓〓 索引初始化加载完成！！");
    }
}
